package com.android.settings.audio.peq.soundeffect;

import java.util.Objects;

public class SoundEffectConfig implements java.io.Serializable {
    private String id;
    private String name;
    private boolean isSystem;
    private String dataUrl;
    private String systemData;//缓存 通过 dataUrl 下载的系统预设数据, 新需求需要缓存

    public void setSystemData(String systemData) {
        this.systemData = systemData;
    }

    public String getSystemData() {
        return systemData;
    }

    private boolean isChecked;

    private String serverDataId;

    /////////////////只有服务端的数据需要/////////////////////
    private boolean isServerConfig;
    private String configData;
    private ServerConfigList.DataList.ListDTO serverConfigData;
    /////////////////只有服务端的数据需要/////////////////////

    public SoundEffectConfig(String id, String name, boolean isSystem) {
        this(id, name, isSystem, null, false, null);
    }

    public SoundEffectConfig(String id, String name, boolean isSystem, boolean isChecked) {
        this(id, name, isSystem, null, isChecked, null);
    }

    public SoundEffectConfig(String id, String name, boolean isSystem, String dataUrl) {
        this(id, name, isSystem, dataUrl, false, null);
    }

    public SoundEffectConfig(String id, String name, boolean isSystem, String dataUrl, boolean isChecked, String serverDataId) {
        this.id = id;
        this.name = name;
        this.isSystem = isSystem;
        this.dataUrl = dataUrl;
        this.isChecked = isChecked;
        this.serverDataId = serverDataId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSystem() {
        return isSystem;
    }

    public String getDataUrl() {
        return dataUrl;
    }

    public String getId() {
        return id;
    }

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SoundEffectConfig that = (SoundEffectConfig) o;
        return isSystem == that.isSystem && id.equals(that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, isSystem);
    }


    public void setServerConfig(boolean serverConfig) {
        isServerConfig = serverConfig;
    }

    public boolean isServerConfig() {
        return isServerConfig;
    }


    public String getServerDataId() {
        return serverDataId;
    }

    public void setServerDataId(String serverDataId) {
        this.serverDataId = serverDataId;
    }

    public ServerConfigList.DataList.ListDTO getServerConfigData() {
        return serverConfigData;
    }

    public void setServerConfigData(ServerConfigList.DataList.ListDTO serverConfigData) {
        this.serverConfigData = serverConfigData;
    }

    public void setConfigData(String configData) {
        this.configData = configData;
    }

    public String getConfigData() {
        return configData;
    }

    @Override
    public String toString() {
        return "SoundEffectConfig{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", isSystem=" + isSystem +
                ", dataUrl='" + dataUrl + '\'' +
                ", isChecked=" + isChecked +
                ", serverDataId='" + serverDataId + '\'' +
                ", isServerConfig=" + isServerConfig +
                ", configData='" + configData + '\'' +
                ", serverConfigData=" + serverConfigData +
                '}';
    }
}
